<%--
  Created by IntelliJ IDEA.
  User: lenovo
  Date: 2019/9/9
  Time: 18:33
  To change this template use File | Settings | File Templates.
--%>

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>招聘注册网页</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/layui/css/layui.css">
    <script src="${pageContext.request.contextPath}/js/jquery-3.4.1.js"></script>
    <script src="${pageContext.request.contextPath}/layui/layui.js"></script>
    <link rel="stylesheet"href="${pageContext.request.contextPath}/css/regist.css">
    <script src="${pageContext.request.contextPath}/dist/css/bootstrap.css"></script>
</head>
<body>
<img src="https://img.58cdn.com.cn/ui6/my/images/reg-bg.png"
     id="bg" style="position: absolute;width: 100%;height: 100%;
        top:0;left: 0">
<!--登录导航栏   和logo  欢迎注册  首页  +   帮助-->
<div class="header">
    <div class="top-nav">

        <a href="">
            <img class="logo" width="90"height="40"src="${pageContext.request.contextPath}/images/main.jpg">
        </a>
        <img class="slogen" width="162" height="50"src="${pageContext.request.contextPath}/images/logo2.jpg" style="margin-top: 8px" alt="好工作尽在纳贤招聘">
        <span class="gp"style="display:block;"></span>
        <span class="t1" style="display:block;margin-right: 100px;font-size: 18px">欢迎注册</span>
        <span class="t1"style="font-size: 18px"><a href="login.jsp">去登录</a></span>

        <span class="t1"style="display:block;margin-left: 400px;font-size: 18px"><a href="${pageContext.request.contextPath}/indexAndSearch/index.jsp">首页</a></span>

    </div>
</div>
<!--登录主要部分整体-->
<div class="main">
    <div class="login-box">
        <div class="pop_head">
            <img class="main-logo" src="${pageContext.request.contextPath}/images/main.jpg">
        </div>
        <div class="passwordlogin" style="display: block">
            <div class="change">

                <div class="clear"></div>
            </div>
            <div class="accountlogin">
                <div class="item">
                    <input type="text"class="in" onblur="checkMobile()" id="mobile"
                           placeholder="手机号"maxlength="40"><div id="mobile_prompt"style="color: red"></div>
                    <button class="getcode">获取验证码</button>
                    <div class="username_msg msg"style="display: block">

                        <div class="clear"></div>
                        <div class="item">
                            <div class="slidecode" id="slidecode"></div>
                        </div>
                        <div class="item">
                            <input type="password"name="password" id="password"
                                   placeholder="验证码" autocomplete="new-password"
                                   maxlength="16">
                            <div class="password_msg msg" style="display: block;">
                                <span class="password_msgtext">请输入正确验证码</span>
                                <div class="clear"></div>
                            </div>
                        </div>
                        <div class="item">
                            <td class="center"><input type="password" id="pwd" class="in" onblur="checkPwd()
                            " placeholder="密码"></td>
                            <td><div id="pwd_prompt"style="color: red"></div></td>
                            <div class="password_msg msg" style="display: block;">

                                <div class="clear"></div>
                            </div>
                        </div>
                        <div class="item">

                            <td class="center"><input type="password" id="repwd" class="in" onblur="checkRepwd()"placeholder="确认密码"></td>
                            <td><div id="repwd_prompt"style="color: red"></div></td>
                            <div class="password_msg msg" style="display: block;">

                                <div class="clear"></div>
                            </div>
                        </div>
                        <div class="item">
                            <p class="forgetpwd"><a class href="">忘记密码</a>
                                <a style="margin-right: 20px"href="">账户申诉</a></p>
                            <button id="btn_account" class="btn">注册</button>
                            <div class="protocol">注册即同意<a target="_blank"href="">《纳贤招聘网使用协议》</a>&<a target="_blank"
                                                                                                    href="">《隐私政策》</a></div>
                        </div>
                        <div class="item third">

                            <div class="clear"></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script language="JavaScript">
    function $(elementId){
        return document.getElementById(elementId).value;
    }
    function divId(elementId){
        return document.getElementById(elementId);
    }

    //    password check
    function checkPwd(){
        var pwd = $("pwd");
        var pwdId = divId("pwd_prompt");
        pwdId.innerHTML="";
        var reg = /^[a-zA-Z0-9]{6,16}$/;
        if(reg.test(pwd)==false){
            pwdId.innerHTML = "密码不能含有非法字符，长度在6-16之间";
            return false;
        }
        return true;
    }
    function checkRepwd(){
        var repwd = $("repwd");
        var pwd = $("pwd");
        var repwdId = divId("repwd_prompt");
        repwdId.innerHTML=""
        if(pwd!=repwd){
            repwdId.innerHTML="两次密码不一致";
            return false;
        }
        return true;
    }

    //      手机号验证
    function checkMobile() {
        var mobile = $("mobile");
        var mobileId = divId("mobile_prompt");
        mobileId.innerHTML="";
        var reMobile = /^1\d{10}$/;
        if (reMobile.test(mobile)==false){
            mobileId.innerHTML="手机号输入有误";
            return false;
        }
        return true;
    }

</script>
</body>
</html>

